#include<bits/stdc++.h>
using namespace std;
int n;
int a[10005];
int k[10005],l[10005];
int si=1;
priority_queue<int,vector<int>,greater<int> >q;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    int u;
    for(int i=1;i<=n;i++) {
        cin>>u;
        q.push(u);
    }
    for(int i=1;i<=n;i++){
        a[i]=q.top();
        q.pop();
    }
    k[1]=1;
    for(int i=2;i<=n;i++) if(a[i]!=a[i-1]){
        l[si]=i-1;
        k[++si]=i;
    }
    l[si]=n;
    int li=l[1]-k[1]+1;
    for(int i=1;i<si;i++){
        li=li-(l[i+1]-k[i+1]+1);
        if(li<0) li=0;
        li+=(l[i+1]-k[i+1]+1);
    }
    cout<<li;
    return 0;
}
